package com.ujiuye.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController

public class DemoController {

    @RequestMapping("getuser")
    @PreAuthorize("hasAnyRole('user')")
    public String getUser(){
        return "getuser";
    }


    @RequestMapping("getadmin")
    @PreAuthorize("hasAnyRole('admin')")
    public String getadmin(){
        return "getadmin";
    }


}
